<div layout="column" ng-show="!paperVisible && !questionVisible" style="height:100%">
  <md-toolbar layout="row">
    <div  class="md-toolbar-tools">
      <md-button ng-click="backToClass()">
        <md-icon class="material-icons">home</md-icon>菜单
      </md-button>
      <md-select ng-model="courseSelected" placeholder="选择班级"  flex="50">
        <md-option ng-repeat="course in courseList" ng-click="switchCourse(course._id)" >{{ course.name }}</md-option>
      </md-select>
      <span h2 flex="noshrink">试卷列表</span>
    </div>
  </md-toolbar>
  <md-content style="overflow: auto">
    <md-list flex>
      <md-list-item class="md-3-line" ng-repeat="quiz in quizList" ng-click="switchPaper($index)" ng-init="outerindex=$index">
        <div class="md-list-item-text" layout="column" layout-padding>
          <h3>{{ quiz.name }}：开始时间:{{quiz.time.from|date:'medium'}}</h3>
          <h3>结束时间：{{quiz.time.to|date:'medium'}}</h3>
        </div>
      </md-list-item>
    </md-list>
  </md-content>
</div>
<div layout="column" ng-show="paperVisible && !questionVisible" style="height:100%">
  <md-toolbar>
    <div class="md-toolbar-tools">
      <md-button ng-click="backToList()">返回</md-button>
      <h2>
        <span>试题列表</span>
      </h2>
      <span flex></span>
    </div>
  </md-toolbar>
  <md-content style="overflow: auto">
    <md-list flex>
      <md-list-item class="md-3-line" ng-repeat="question in questions" ng-click="switchQuestion($index)">
        <div class="md-list-item-text" layout="column" layout-padding>
          <h3>{{ "第" + ($index + 1) + "题" }}</h3>
        </div>
      </md-list-item>
    </md-list>
  </md-content>
</div>
<div layout="column" ng-show="questionVisible" style="height:100%">
    <md-toolbar>
      <div class="md-toolbar-tools">
        <md-button class="md-raised md-primary md-hue-1" ng-click="preQuestion()">上一题</md-button>
        <md-button class="md-raised md-primary md-hue-2" ng-click="nextQuestion()">下一题</md-button>
        <span flex></span>
        <md-button class="md-warn md-raised" ng-click="submitQuiz()" ng-show="showSubmitBtn">提交试卷</md-button>
      </div>
    </md-toolbar>
    <md-content style="overflow: auto">
      <md-toolbar>
        <div class="md-toolbar-tools" layout="row">
          <md-button ng-click="backToPaper()">返回</md-button>
          <h2 flex="noshrink">
            <span >{{ "第" + (currentQuestion + 1) + "题"+"（共"+questions.length+"题）" }}</span>
          </h2>
        </div>
      </md-toolbar>
      <div layout-padding>
        <h3> {{ questions[currentQuestion].name }} </h3>
        <!--<md-radio-group ng-model="answers[currentQuestion]">-->
          <!--<md-radio-button ng-repeat="extra in questions[currentQuestion].extras" value= "{{ $index }}">-->
            <!--<h4>{{ extra }}</h4>-->
          <!--</md-radio-button>-->
        <!--</md-radio-group>-->
        <div  layout="column">
          <div ng-show="questions[currentQuestion].answers">正确答案{{questions[currentQuestion].answers}};</div>
          <div ng-show="showDoneMessage">您已经提交过了，下面是您答案</div>
          <md-checkbox ng-show="questions[currentQuestion].type==1" aria-label="check"  ng-model="answer[currentQuestion][$index]" ng-repeat="extra in questions[currentQuestion].extras track by $index"  layout-align="center center" title="设为正确答案">
          {{alphabet($index)}}.{{extra}}
          </md-checkbox>
          <md-input-container  ng-show="questions[currentQuestion].type==2"  ng-model="answer[currentQuestion][$index]" ng-repeat="extra in questions[currentQuestion].extras track by $index"  flex >
            <label>{{extra}}</label>
            <input ng-model="answer[currentQuestion][$index]">
          </md-input-container>
        </div>

      </div>
    </md-content>
</div>
